package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.dto.SetmealDTO;
import com.sky.entity.Dish;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import lombok.Data;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface  SetmealDDMapper {

    /**
     * 新增套餐
     * @param setmealDishes
     */
    @AutoFill(value = OperationType.INSERT)
    void saveSetmealDish(SetmealDish setmealDishes);


    /**
     * 查询套餐菜品关系
     * @param id
     * @return
     */
    @Select("select * from setmeal_dish where setmeal_id = #{setmealId}")
    List<SetmealDish> getId(Long id);

    /**
     * 回显套餐菜品信息
     * @param setmealDishes
     */
    void updateSeteamlDish(List<SetmealDish> setmealDishes);


    /**
     *删除套餐
     * @param aid
     */
    @Delete("delete from setmeal_dish where setmeal_id=#{setmealId}")
    void deteleSeteamlDishId(Long aid);



}
